<?php

    $_->Images->imgview('pic/xihu.jpg',0.8);exit;
	$title = '有伴儿童';
	$url = 'http://www.youban.com';
	$data = get_data_from_youban($url);
	
	

	$content = get_data_content('http://www.youban.com/know/');
	preg_match_all("/<img src=\"(?:[^\"]*)\" original=\"([^\"]*)\" width=\"137\" height=\"155\" \/>/",$content, $temp, PREG_PATTERN_ORDER);
	$imgs = $temp[1];
	preg_match_all("/<li>·<a href=\"([^\"]*)\" target=\"_blank\">([^\"]*)<\/a><\/li>/",$content, $temp, PREG_PATTERN_ORDER);
	//$links = $temp[1];
	$names = $temp[2];
	$unit = count($names)/count($imgs);
	foreach($imgs as $key=>$val)
	{
		$yuer[] = array(
			'tu' => array(
					'img'=>$val,
				),
			'wen' => array_slice($names,$key*$unit,$unit)
		);
	}

	$smarty->_assign(array('title','data','yuer'));
	$smarty->_display();
?>